var getProfile=function(){
    
       if (window.XMLHttpRequest) { // Mozilla, Safari, ...
          httpRequest = new XMLHttpRequest();
    } else if (window.ActiveXObject) { // IE
      try {
        httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } 
    catch (e) {
        try {
          httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } 
      catch (e) {}
  }
}

if (!httpRequest) {
  alert('Giving up :( Cannot create an XMLHTTP instance');
      return false;
  }

    httpRequest.onreadystatechange = alertContents;
    httpRequest.open('GET', "http://98.189.99.218:60020/node/rest_api_el700/api/metering/housholdsum/abc123?cat=7D&date=2013-03-09");
    httpRequest.send();
};



function alertContents() {
    if (httpRequest.readyState === 4) {
      if (httpRequest.status === 200) {
          console.log(httpRequest.responseText);
      } else {
        alert('There was a problem with the request.');
      }
    }
  }

$(document).ready(function () {

        getProfile();
        var xArray = ["a", "b", "c", "d", "e"];
        var yArray = [-20, 0, 30, -50, 100];
        $("#wijlinechart").wijlinechart({
            axis: {
                y: {
                    origin: 0
                }
            },
            showChartLabels: false,
            header: {
                             text: "Usage Chart"
                         },
            hint: {
                content: function () {
                    return this.data.lineSeries.label + '\n' +
                        this.x + '\n' + this.y + '';
                },
                contentStyle: {
                    "font-size": 10
                },
                offsetY: -10
            },
            legend: {
                visible: false
            },
            seriesList: [
                    {
                        label: "Usage",
                        legendEntry: true,
                        data: {
                            x: xArray,
                            y: yArray
                        },
                        markers: {
                            visible: true,
                            type: "circle"
                        }
                    }
                ]
        });
    });
